package metier;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;



public class Exemplaire {
	private	int idExamplaire = 0;
	private GregorianCalendar dateAchat ;
	private EnumStatusExamplaire status;
	public static SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
	private String isbn;
	
	public Exemplaire(int idExamplaire, GregorianCalendar dateAchat,EnumStatusExamplaire status, String isbn) {
		this.idExamplaire = idExamplaire;
		this.dateAchat = dateAchat;
		this.status = status;
		this.isbn = isbn;
	}
	
	public Exemplaire() throws ParseException{
		super();
	}


	public int getIdExamplaire() {
		return idExamplaire;
	}

	public void setIdExamplaire(int idExamplaire) {
		this.idExamplaire = idExamplaire;
	}

	public GregorianCalendar getDateAchat() {
		
		this.dateAchat = dateAchat;
		return dateAchat;
	}

	
	public void setDateAchat(Date dattAchat) {
		this.dateAchat = dateAchat;
	}

	public EnumStatusExamplaire getStatus() {
		return status;
	}

	public void setStatus(EnumStatusExamplaire status) {
		this.status = status;
	}

	public String getIsbn() {
		return isbn;
	}

	public void setIsbn(String isbn) {
		this.isbn = isbn;
	}

	@Override
	public String toString() {
		return "N° Exemplaire : " + idExamplaire + "\nDateAchat : "
				+ sdf.format(dateAchat.getTime()) + "\nStatus : " + status + "\nISBN : " + isbn ;
	}


}
